import { http } from '/@/utils/http/request';
import { BasicResponseModel } from '/@/types/http';

import { LoginData, LoginResult } from '/@/api/system/login/types';

/**
 * @description: 用户登录
 */
export function login(params: LoginData) {
  return http.request<BasicResponseModel<LoginResult>>({
    url: '/user/login',
    method: 'POST',
    params,
  });
}

/**
 * @description: 用户登出
 */
export function logout() {
  return http.request({
    url: '/user/logout',
    method: 'POST',
  });
}

export default {
  login,
  logout,
};
